/**
 * @param id - 班级 id
 * @param recover_user_id - 老师 id
 */
interface FetchInitialMessageListAPIData {
  id: string
  recover_user_id: string
  limit: string
  page: string
}

interface FetchInitialMessageListAPIResData {
  code: number
  msg: string
  time: string
  data: {
    data: Message[]
    current_page: number
    total: number
    per_page: number
    last_page: number
  }
}

/**
 * @description 根据传入的班级 id 和老师 id，分页获取聊天（留言）信息列表数据
 */
export function fetchInitialMessageListAPI(data: FetchInitialMessageListAPIData, token: string) {
  return httpInstance.post<FetchInitialMessageListAPIResData, FetchInitialMessageListAPIData>(
    '/api/message/contactmessagedetail',
    data,
    { headers: { token } },
  )
}
